Skip to content

Conversation

@mladedav
Copy link
Collaborator

Motivation

There is a potential deadlock described in #250 where we lock ExtensionsMut when entering a span, we let opentelemetry activate the context, it tries to log through tracing in that operation which in turn calls on_event in this layer and we try to lock ExtensionsMut again.

Solution

We disable tracing for the operation in question. We cannot just check whether we already hold the lock because any other layer might try to lock the extensions too.

We could alternatively release the lock for the operation but that would mean we need to relock it later and for the duration we either have a clone or we had to take out the OtelData from the extensions and that could cause its own problems.

There's no test to check for this because that would involve making sure that opentelemetry logged something in a given operation but I did try the repro mentioned in #250 and this seems to have fixed that.

@mladedav
Copy link
Collaborator Author

I'll have to look closer at what's happening with the RefCell when setting the dispatch. It's at least panicking consistently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant